//
//  SettingLayer.m
//  lust
//
//  Created by fan on 13-3-28.
//
//

#import "SettingLayer.h"
#import "cocos2d.h"
@implementation SettingLayer
+(CCScene*)scene
{
    CCScene* scene=[CCScene node];
    [scene addChild:[SettingLayer node]];
    return scene;
}

-(id)init
{
    self=[super init];
    if (self) {
        [CCMenuItemFont setFontName:@"American Typewriter"];
        [CCMenuItemFont setFontSize:18];
        
        CCMenuItemFont* title1=[CCMenuItemFont itemWithString:@"Sound"];
        [title1 setIsEnabled:NO];
        
        [CCMenuItemFont setFontName:@"Marker Felt"];
        [CCMenuItemFont setFontSize:26];
        
        CCMenuItemToggle* item1=[CCMenuItemToggle itemWithTarget:self selector:@selector(menuCallback) items:[CCMenuItemFont itemWithString:@"ON"],[CCMenuItemFont itemWithString:@"OFF"], nil];
        [CCMenuItemFont setFontName:@"American Typewriter"];
        [CCMenuItemFont setFontSize:18];
        CCMenuItemFont* title2=[CCMenuItemFont itemWithString:@"MUSIC"];
        [title2 setIsEnabled:NO];
        
        [CCMenuItemFont setFontName:@"Marker Felt"];
        [CCMenuItemFont setFontSize:26];
        CCMenuItemToggle* item2=[CCMenuItemToggle itemWithTarget:self selector:@selector(menuCallback:) items:[CCMenuItemFont itemWithString:@"ON"],[CCMenuItemFont itemWithString:@"OFF"], nil];
        
        CCMenu* menu=[CCMenu menuWithItems:title1,title2,item1,item2, nil];
        [menu alignItemsInColumns:
         [NSNumber numberWithUnsignedInt:2],
         [NSNumber numberWithUnsignedInt:2],
         [NSNumber numberWithUnsignedInt:2],
         [NSNumber numberWithUnsignedInt:2],
         [NSNumber numberWithUnsignedInt:1], nil
         ];
        menu.position=ccp(180,240);
        menu.anchorPoint=CGPointMake(0.5, 0.5);
        [self addChild:menu z:2 tag:2];
    }
    return self;
}
@end
